import http from '@/request/request'


// 获取用户信息
export function getRoleList() {
    return http({
        url: '/role/list',
        method: 'get',
    })
}


export function addRoles(roleInfo) {
    return http({
        url: '/role/',
        method: 'post',
        data: roleInfo,
    })
}

export function delById(roleId) {
    return http({
        url: '/role/del',
        method: 'post',
        data: roleId,
    })
}

export function updateById(roleInfo) {
    return http({
        url: '/role/update',
        method: 'post',
        data: roleInfo,
    })
}


export function getAuthIdByRoleId(roleId) {
    return http({
        url: `/role/getAuthId?roleId=${roleId}`,
        method: 'get',
    })
}


export function updateRights(roleId,authIds) {
    return http({
        url: `/role/updateRights`,
        method: 'post',
        data: {
            roleId:roleId,
            authIds:authIds
        }
    })
}
